Methods for compressing video data include MPEG-2, MPEG-4 and H.264/MPEG-4 AVC. According to these methods, one picture is divided into macroblocks to encode an image, the respective macroblocks are encoded by generating a prediction block using inter prediction or intra prediction. The difference between an original block and the prediction block is transformed to generate a transformed block, and the transformed block is quantized using a quantization parameter and one of a plurality of predetermined quantization matrices. The quantized coefficient of the quantized block are scanned by a predetermined scan type and then entropy-coded. The quantization parameter is adjusted per macroblock and encoded using a previous quantization parameter.
In H.264/MPEG-4 AVC, motion estimation is used to eliminate temporal redundancy between consecutive pictures. To detect the temporal redundancy, one or more reference pictures are used to estimate motion of a current block, and motion compensation is performed to generate a prediction block using motion information. The motion information includes one or more reference picture indexes and one or more motion vectors. The motion vector of the motion information is predictively encoded using neighboring motion vectors, and the reference picture indexes are encoded without neighboring reference picture indexes.
However, if various sizes are used for inter prediction, the correlation between motion information of a current block and motion information of one or more neighboring block increases. Also, if a motion of a current block is similar to or same as one of neighboring blocks, it is more effective to predictively encode the motion information using motion information of the neighboring blocks.